package com.lbg.drug.service.impl;

import com.lbg.drug.commont.untils.PageUtils;
import com.lbg.drug.dto.StockPage;
import com.lbg.drug.mapper.AdminMapper;
import com.lbg.drug.mapper.DrugFactsMapper;
import com.lbg.drug.mapper.StockMapper;
import com.lbg.drug.service.StockService;

import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.stereotype.Service;


/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author lbg
 * @since 2022-04-26
 */
@Service
public class  StockServiceImpl implements StockService {


    @Autowired
    private StockMapper stockMapper;




    @Override
    public PageUtils getStock(StockPage stockPage) {
        stockPage.setCurrIndex((stockPage.getPageNo()-1)*stockPage.getPageSize());
        stockPage.setEndIndex(stockPage.getPageSize());
        PageUtils pageUtils = new PageUtils(stockMapper.getStockId(stockPage),stockMapper.getCount(stockPage));
        return pageUtils;
    }
}
